Loading...
 

MATLAB implementation of the advection-diffusion problem with SUPG

Below you can find a link to the MATLAB code calculating the advection-diffusion problem with the finite element method with Streamline Upwind Petrov-Galerkin (SUPG) stabilization for the model Eriksson-Johnson problem.

Let us recall first the advection-diffusion problem, the Eriksson-Johnson model problem (described, for example, in [1]), defined on a square domain \( \Omega = [0,1]^2 \) in the following way. We seek \( u \) such as
\( a(u,v)=l(v) \forall v \) where
\( a(u,v) =\int_{\Omega} \beta_x(x,y) \frac{\partial u(x,y) }{\partial x } dxdy + \int_{\Omega} \beta_y(x,y) \frac{\partial u(x,y)}{\partial y } dxdy \\ +\epsilon \int_{\Omega} \frac{\partial u(x,y) }{\partial x} \frac{\partial v(x,y)}{\partial x } dxdy +\epsilon \int_{\Omega} \frac{\partial u(x,y)}{\partial y } \frac{\partial v(x,y)}{\partial y } dxdy \)
\( l(v) = \int_{\partial \Omega } f(x,y) v dxdy \)
\( f(x,y)=sin(\pi y)(1-x) \)
is an extension of the Dirichlet boundary condition to the entire area, while \( \beta = (1,0) \) represents the wind blowing from left to right, while \( \epsilon = 10^{-2} \) is the diffusion coefficient. The quantity \( Pe=1/ \epsilon = 100 \) is called the Peklet number, and it defines the sensitivity of the advection-diffusion problem.

In line 848 we setup the diffusion coefficient \( \epsilon = 10 ^{-2} \).
Its inverse is the so-called Peclet number
\( Pe=\frac{1}{\epsilon} \).
SUPG parameters are setup in lines 849 and 850.
Then a vector of nodes is created (always natural numbers counted from zero) \( knot\_x = [0 \quad 0 \quad 0 \quad 1 \quad 2 \quad 2 \quad 2] \) for the trial space,
and the knot vector along x axis from (0,1) interval, \( points\_x = [0 \quad 0.5 \quad 1] \) which will contain the basis of B-spline functions used to approximate the solution to the Eriksson-Johnson problem. The node vectors for the approximating space and the points on which we span the node vectors are defined separately for the x axis and for the y axis.

The code execution is also possible in the free Octave(external link) environment.
Download code(external link) or see Appendix 5.

The code is activated by opening it in Octave and typing a command
\( advection\_supg\_adapt \)
After a moment of calculation, the code opens an additional window and draws a numerical and exact solution in it.
The code calculates the residuum error
\( Residual norm: L2 0.015808, H1 0.100417 \)
The code also computes the norm L2 and H1 from the solution
\( Error: L2 31.41 procent, H1 38.74 percent \)
and compares to the L2 and H1 standards from the exact solution.
\( Best possible: L2 2.06 procent, H1 28.73 percent \)
You can see that in order to improve the accuracy of the solution, it is necessary to compact the mesh.

Exercise 1: Uniform mesh refinement

Content of exercise:
Increase the number of points to five in the x and y directions, keeping the degrees of the B-spline polynomials. Please check how this operation improves the accuracy of the solution.

Exercise 2: Adaptive mesh refinement

Content of exercise:
Please increase the number of points adaptively towards the right bank [0 0.5 0.9 0.95 1] where the coastal layer is, keeping the degrees of B-spline polynomials. Please check how this operation improves the accuracy of the solution

Exercise 3: Adaptive increasing the trial grid and test by breaking in half the element closest to the singularity for a large value Peclet number

Content of exercise:
Please modify the problem so that the Peclet number is one million. Please start from the grid [0 0.5 1] in the x direction and [0 0.25 0.5 0.75 1] in the y direction, and increase adaptively the number of points towards the right edge where the boundary layer is, keeping the degrees of B-spline polynomials in the trial space and test. Please check how this operation improves the accuracy of the solution.

Ostatnio zmieniona Wtorek 09 z Listopad, 2021 12:38:05 UTC Autor: Maciej Paszynski
Zaloguj się/Zarejestruj w OPEN AGH e-podręczniki
Czy masz już hasło?

Hasło powinno mieć przynajmniej 8 znaków, litery i cyfry oraz co najmniej jeden znak specjalny.

Przypominanie hasła

Wprowadź swój adres e-mail, abyśmy mogli przesłać Ci informację o nowym haśle.
Dziękujemy za rejestrację!
Na wskazany w rejestracji adres został wysłany e-mail z linkiem aktywacyjnym.
Wprowadzone hasło/login są błędne.